.class public Lorg/microemu/cldc/file/FileSystem;
.super Ljava/lang/Object;
.source "FileSystem.java"

# interfaces
.implements Lorg/microemu/microedition/ImplementationInitialization;


# static fields
.field static class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class; = null

.field static class$org$microemu$cldc$file$FileSystemRegistryImpl:Ljava/lang/Class; = null

.field public static final detectionProperty:Ljava/lang/String; = "microedition.io.file.FileConnection.version"

.field public static final fsRootConfigProperty:Ljava/lang/String; = "fsRoot"

.field public static final fsSingleConfigProperty:Ljava/lang/String; = "fsSingle"


# instance fields
.field private impl:Lorg/microemu/cldc/file/FileSystemConnectorImpl;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 53
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static class$(Ljava/lang/String;)Ljava/lang/Class;
    .locals 2
    .parameter "x0"

    .prologue
    .line 77
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    :catch_0
    move-exception v0

    .local v0, x1:Ljava/lang/ClassNotFoundException;
    new-instance v1, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v1}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object v1

    throw v1
.end method

.method protected static unregisterImplementation(Lorg/microemu/cldc/file/FileSystemConnectorImpl;)V
    .locals 2
    .parameter "impl"

    .prologue
    .line 82
    const-string v0, "microedition.io.file.FileConnection.version"

    invoke-static {v0}, Lorg/microemu/app/util/MIDletSystemProperties;->clearProperty(Ljava/lang/String;)Ljava/lang/String;

    .line 83
    const-string v0, "file"

    invoke-static {v0, p0}, Lorg/microemu/microedition/ImplFactory;->unregistedGCF(Ljava/lang/String;Ljava/lang/Object;)V

    .line 84
    sget-object v0, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    if-nez v0, :cond_0

    const-string v0, "org.microemu.cldc.file.FileSystemRegistryDelegate"

    invoke-static {v0}, Lorg/microemu/cldc/file/FileSystem;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    sput-object v0, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    :goto_0
    sget-object v1, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryImpl:Ljava/lang/Class;

    if-nez v1, :cond_1

    const-string v1, "org.microemu.cldc.file.FileSystemRegistryImpl"

    invoke-static {v1}, Lorg/microemu/cldc/file/FileSystem;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    sput-object v1, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryImpl:Ljava/lang/Class;

    :goto_1
    invoke-static {v0, v1}, Lorg/microemu/microedition/ImplFactory;->unregister(Ljava/lang/Class;Ljava/lang/Class;)V

    .line 85
    return-void

    .line 84
    :cond_0
    sget-object v0, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    goto :goto_0

    :cond_1
    sget-object v1, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryImpl:Ljava/lang/Class;

    goto :goto_1
.end method


# virtual methods
.method public notifyMIDletDestroyed()V
    .locals 1

    .prologue
    .line 101
    iget-object v0, p0, Lorg/microemu/cldc/file/FileSystem;->impl:Lorg/microemu/cldc/file/FileSystemConnectorImpl;

    invoke-virtual {v0}, Lorg/microemu/cldc/file/FileSystemConnectorImpl;->notifyMIDletDestroyed()V

    .line 102
    return-void
.end method

.method public notifyMIDletStart()V
    .locals 0

    .prologue
    .line 93
    return-void
.end method

.method public registerImplementation(Ljava/util/Map;)V
    .locals 4
    .parameter "parameters"

    .prologue
    .line 73
    const-string v2, "fsRoot"

    invoke-interface {p1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 74
    .local v0, fsRoot:Ljava/lang/String;
    const-string v2, "fsSingle"

    invoke-interface {p1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 75
    .local v1, fsSingle:Ljava/lang/String;
    new-instance v2, Lorg/microemu/cldc/file/FileSystemConnectorImpl;

    invoke-direct {v2, v0}, Lorg/microemu/cldc/file/FileSystemConnectorImpl;-><init>(Ljava/lang/String;)V

    iput-object v2, p0, Lorg/microemu/cldc/file/FileSystem;->impl:Lorg/microemu/cldc/file/FileSystemConnectorImpl;

    .line 76
    const-string v2, "file"

    iget-object v3, p0, Lorg/microemu/cldc/file/FileSystem;->impl:Lorg/microemu/cldc/file/FileSystemConnectorImpl;

    invoke-static {v2, v3}, Lorg/microemu/microedition/ImplFactory;->registerGCF(Ljava/lang/String;Ljava/lang/Object;)V

    .line 77
    sget-object v2, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    if-nez v2, :cond_0

    const-string v2, "org.microemu.cldc.file.FileSystemRegistryDelegate"

    invoke-static {v2}, Lorg/microemu/cldc/file/FileSystem;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v2

    sput-object v2, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    :goto_0
    new-instance v3, Lorg/microemu/cldc/file/FileSystemRegistryImpl;

    invoke-direct {v3, v0, v1}, Lorg/microemu/cldc/file/FileSystemRegistryImpl;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-static {v2, v3}, Lorg/microemu/microedition/ImplFactory;->register(Ljava/lang/Class;Ljava/lang/Object;)V

    .line 78
    const-string v2, "microedition.io.file.FileConnection.version"

    const-string v3, "1.0"

    invoke-static {v2, v3}, Lorg/microemu/app/util/MIDletSystemProperties;->setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    .line 79
    return-void

    .line 77
    :cond_0
    sget-object v2, Lorg/microemu/cldc/file/FileSystem;->class$org$microemu$cldc$file$FileSystemRegistryDelegate:Ljava/lang/Class;

    goto :goto_0
.end method
